<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
response.setHeader("Content-type","application/vnd.ms-excel");
response.setHeader("Content-disposition","inline; filename=Clientes.xls");
%>
<%@ page language="java" import='java.util.ArrayList'%>
<%@ page language="java" import='java.util.List'%>
<%@ page language="java" import='pe.gov.mtc.dgac.licencias.bean.*'%>
<%@ page language="java" import='pe.gov.mtc.dgac.licencias.util.*'%>
<%@ page language="java" import='java.text.DecimalFormat'%>

<% String busqueda=request.getParameter("busqueda");
   boolean bus=false;
   if(busqueda!=null)bus=true; 
%>
<html><head><title>LISTADO DE DATOS</title>
<link href="/WebLicencias/css/espacio.css" type=text/css rel=stylesheet>
<link href="/WebLicencias/css/calendar-system.css" type=text/css rel=stylesheet>

<body>
<div id="idTabla" style="DISPLAY: inline">
<table width="100%" align="center" bgcolor="#fffdd6" border="0">
  <tbody>
  <tr>
    <td>
      <div class="Titulo1B" align="center">LISTADO DE CLIENTES</div></td></tr>
  <tr>
  <tr>
    <td>
      <div id="res">
      <br>
      <table class="consultanormal" id="row" cellspacing="0" align="center">
        <thead>
        <tr>
          <th class="sortable" width="5%">Ver&nbsp;&nbsp;</th>
          <th class="sortable" width="15%"><a style="COLOR: white" 
            href="#">Codigo</a></th>
          <th class="sortable" width="20%"><a style="COLOR: white" 
            href="#">Nombre&nbsp;&nbsp;</a></th>
          <th class="sortable" width="10%"><a style="COLOR: white" href="#">Tipo 
            Doc</a></th>
          <th class="sortable" width="15%"><a style="COLOR: white" href="#">No 
            Documento</a></th>
          <th class="sortable" width="15%"><a style="COLOR: white" href="#">Fec 
            Nacimiento</a></th>
          <th class="sortable" width="15%"><a style="COLOR: white" href="#">Nacionalidad
          </a></th></tr></thead>
        <tbody>
        <%
           Page result=(Page) request.getSession().getAttribute("listClientes");
           
           int hits=0;
           if (result!=null) {
           
           
           ArrayList listcli = (ArrayList) result.getResults();
           if (listcli!=null) {              
           hits=listcli.size(); 
           for (int i = 0; i < listcli.size(); i++) {
                    ClienteTO cli = (ClienteTO) listcli.get(i);
                    String[] clase = {"odd","even"};
         %>    
        <tr class="<%=(clase[i%2])%>">
          <td>
         
             <div align="center"></div>
         
            </td>
          <td class="TextoTabla8">
            <div align="center"><%= cli.getCodCliente() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= cli.getNombreCompleto() %> </div></td>
          <td class="TextoTabla8">
            <div align="center"><%= cli.getTipoIdDoc().getDescripcion() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= cli.getNumIdDoc() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= cli.getSfecha_nac() %></div></td>
          <td class="TextoTabla8">
            <div align="center"><%= cli.getNacionalidad() %></div></td></tr>
        <%
          }
        }
       }
           if(hits==0){
            %>
            
          <tr class="odd">
          <td>
            <div align="center"> </div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td>
          <td class="TextoTabla8">
            <div align="center"></div></td></tr>
         <%
           }
        %>     
        </tbody></table>
      <br>
      <br>    
 </body></html>
